<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.createCourseTitle}"></h:outputText>
        </ui:define>
        <ui:define name="content">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.courseCode}:" for="courseCode" />
                    <h:inputText id="courseCode" value="#{courseController.selected.courseCode}" title="#{bundle.courseCode}" required="true" requiredMessage="#{bundle.OBLIG}"/>
                    <h:outputLabel value="#{bundle.nameEn}:" for="courseName" />
                    <h:inputText id="courseName" value="#{courseController.selected.courseName}" title="#{bundle.nameEn}" required="true" requiredMessage="#{bundle.OBLIG}"/>
                    <h:outputLabel value="#{bundle.nameNo}:" for="courseNameNo" />
                    <h:inputText id="courseNameNo" value="#{courseController.selected.courseNameNo}" title="#{bundle.nameNo}" required="true" requiredMessage="#{bundle.OBLIG}"/>
                    <h:outputLabel value="#{bundle.faculty}:" for="faculty" />
                    <h:selectOneMenu id="faculty" value="#{courseController.selected.faculty}" title="#{bundle.faculty}" required="true" requiredMessage="#{bundle.OBLIG}">
                        <f:selectItems value="#{facultyController.itemsAvailableSelectManyOfMyFaculties}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{courseController.create}" value="#{bundle.SAVE}" />
                <br />
                <br />
                <h:commandLink value="#{bundle.CANCEL}" action="mypage" immediate="true" />
                <br />
                <br />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
